home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 287_01 / arcpoint.c < prev    next >
Text File  |  1989-05-23  |  896b  |  51 lines

  1. #include <stdio.h>
  2. #include <gds.h>
  3.  
  4. extern int ARCSTTX, ARCSTTY, ARCSTTR, ARCENDX, ARCENDY, ARCENDR;
  5.  
  6. ArcPoint(stx,sty,endx,endy)
  7. int *stx, *sty, *endx, *endy;
  8. {
  9.     findarcpoint(stx,sty,ARCSTTX, ARCSTTY, ARCSTTR);
  10.     findarcpoint(endx,endy,ARCENDX, ARCENDY, ARCENDR);
  11.     *stx+=LASTX-ORGX;
  12.     *endx+=LASTX-ORGX;
  13.     *sty+=LASTY-ORGY;
  14.     *endy+=LASTY-ORGY;
  15. }
  16.  
  17. static findarcpoint(x,y,ax,ay,region)
  18. int *x, *y, ax, ay, region;
  19. {
  20.     *x=ax;
  21.     *y=-ay;
  22.     switch(region) {
  23.     case 1:
  24.         *x=ay;
  25.         *y=-ax;
  26.         break;
  27.     case 2:
  28.         *x=ay;
  29.         *y=ax;
  30.         break;
  31.     case 3:
  32.         *y=ay;
  33.         break;
  34.     case 4:
  35.         *x=-ax;
  36.         *y=ay;
  37.         break;
  38.     case 5:
  39.         *x=-ay;
  40.         *y=ax;
  41.         break;
  42.     case 6:
  43.         *x=-ay;
  44.         *y=-ax;
  45.          break;
  46.    case 7:
  47.         *x=-ax;
  48.     }
  49. }
  50.  
  51.